<!DOCTYPE html>
<html>
<head lang="zh-cn">
    <link href="$!{__beat.server.contextPath}/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link href="$!{__beat.server.contextPath}/bootstrap/datepicker/datepicker3.css" rel="stylesheet">
    <link rel="stylesheet" href="$!{__beat.server.contextPath}/bootstrap/css/App.css" type="text/css" />
    <link rel="stylesheet" href="$!{__beat.server.contextPath}/bootstrap/css/font-awesome.min.css" type="text/css" />
    
    <link rel="stylesheet" type="text/css" href="$!{__beat.server.contextPath}/css/wnl.css">
    <meta charset="UTF-8">
    
    <title>简历数据看板</title>
</head>
<body>

<div class="container-fluid">

    <div class="datacontent"  >
        <div class="dataTit">
                <i class="mark"></i><span>$!{businessName_CN}新增简历趋势</span>
        </div>

        <div class="dataShow">
            <div id='resumeAddOption' dateGrp='stat_date'>
                <form class="form-inline">
                    <div  class="input-group input-group-sm" style="width: 20%;float: left">
                        <span class="input-group-addon">
                            <input id="time_checkbox_resumeAdd" type="checkbox">
                        </span>
                        <input id="time_input_resumeAdd" type="text" class="form-control time" placeholder="添加对比" disabled>
                    </div>
  

                    <div class="form-group"  style="margin-left: 20%">
                       <label for="index_industry">期望职位：</label>
                        <select id="index_industry" class="form-control input-sm">
                            <option value="all">全部</option>
                            <option value="全职">全职简历</option>
                            <option value="兼职">兼职简历</option>
                            #foreach($!{p} in ${cateTwoList})
                                <option value="$!{p}">$!{p}</option>
                            #end
                        </select>
                    </div>


                    <div class="btn-group btn-group-sm btn-tab" role="group" aria-label="Basic example"  style="float: right">
                        <button type="button" class="btn btn-default active btnResumeAdd" dateGrp='stat_date'>日</button>
                        <button type="button" class="btn btn-default btnResumeAdd" dateGrp='week_begin'>周</button>
                        <button type="button" class="btn btn-default btnResumeAdd" dateGrp='month_num'>月</button>
                    </div>
                </form>
            </div>
            
            <div id="resumeAdd_EC" style="height:380px"></div>
        </div>
    </div> <!--end of datacontent -->



    <div class="datacontent" id="qsContent">
        <div class="dataTit"><!-- 整体流量   -->
            <i class="mark"></i><span>$!{businessName_CN}全职简历求职者画像</span>
        </div>
        <div class="dataShow">
            <div id='resumeOption_crowd' dateGrp='stat_date'>
                <form class="form-inline">
                    <label for="beginDate_crowd">时间段: </label>
                    <div class="form-group input-group input-group-sm" style="width: 13%;">
                        <input id="beginDate_crowd" type="text"  class="form-control input-sm time" placeholder="选择起始时间" value="$!{maxDate}"/>
                    </div>
                    <label for="beginDate_crowd"> -- </label>
                    <div class="form-group input-group input-group-sm" style="width: 13%;">
                        <input id="endDate_crowd" type="text"  class="form-control input-sm time" placeholder="选择起始时间" value="$!{maxDate}"/>
                    </div>                    
                    <div class="form-group" style="margin-left: 10px">
                       <label for="index_crowd_industry">期望职位：</label>
                        <select id="index_crowd_industry" class="form-control input-sm">
                            #foreach($!{p} in ${cateTwoList})
                                <option value="$!{p}">$!{p}</option>
                            #end
                        </select>
                    </div>

<!--                     <div class="form-group" style="margin-left: 5px">
                    <label for="index_crowd">分类：</label>
                        <select id="index_crowd" class="form-control input-sm" >
                            <option value="age">年龄</option>
                            <option value="education">学历</option>
                            <option value="work_years">工作年限</option>
                            <option value="salary_name">期望薪资</option>
                        </select>
                    </div> -->

                     <button id="refresh_crowd_btn" type="button" class="btn btn-default form-control input-sm">刷新</button>
                </form>           
            </div>
            
            <div class="row">
                <div id="resume_pie_age" class="col-md-6" style="height:300px"></div>
                <div id="resume_pie_education" class="col-md-6"  style="height:300px;"></div>
            </div>
            <div class="row">
                <div id="resume_pie_work_years" class="col-md-6" style="height:300px"></div>
                <div id="resume_pie_salary_name" class="col-md-6"  style="height:300px;"></div>
            </div>            
            
        </div>
    </div>     <!-- datacontent  -->


</div>
</body>
<script src="$!{__beat.server.contextPath}/bootstrap/jquery.js"></script>

<link rel="stylesheet" href="$!{__beat.server.contextPath}/bootstrap/libs/jquery-ui/jquery-ui-1.9.2.custom.css" type="text/css" /> 
<link type="text/css" href="$!{__beat.server.contextPath}/bootstrap/libs/jquery-ui/jquery.multiselect.css" rel="stylesheet" />
<script src="$!{__beat.server.contextPath}/bootstrap/libs/jquery-ui/jquery-ui-1.9.2.custom.min.js"></script>
<script type="text/javascript" src="$!{__beat.server.contextPath}/bootstrap/libs/jquery-ui/jquery.multiselect.js"></script>


<script src="$!{__beat.server.contextPath}/bootstrap/js/libs/bootstrap.js"></script>
<script src="$!{__beat.server.contextPath}/bootstrap/datepicker/bootstrap-datepicker.js"></script>
<script src="$!{__beat.server.contextPath}/bootstrap/datepicker/nongLiDate.js"></script>
<script src="$!{__beat.server.contextPath}/bootstrap/datepicker/locales/bootstrap-datepicker.zh-CN.js"></script>
<script src="$!{__beat.server.contextPath}/echarts2/source/echarts.js"></script>
<!-- <script src="$!{__beat.server.contextPath}/js/wnl.js"></script> -->
<script src="$!{__beat.server.contextPath}/bootstrap/js/App.js"></script>
<script type="text/javascript">
    var businessName = "$!{businessName}";
    var dayMap={1:"周一",2:"周二",3:"周三",4:"周四",5:"周五",6:"周六",0:"周日"};
	var datepicker_op={
        format: "yyyy-mm-dd",
        clearBtn: false,
        language: "zh-CN",
        autoclose: true,
        todayHighlight: true,
        minViewMode:0,
		orientation: "top left",
        startDate:"2014-01-01",
        endDate:"$!maxDate"        
    };

	function getDate(yyyymmdd){
        if(yyyymmdd.length==10){        //yyyy-MM-dd
            return Date.parse(yyyymmdd.substr(0,4)+'/'+yyyymmdd.substr(5,2)+'/'+yyyymmdd.substr(8,2));
        }else if(yyyymmdd.length==8){
            return Date.parse(yyyymmdd.substr(0,4)+'/'+yyyymmdd.substr(4,2)+'/'+yyyymmdd.substr(6,2));
        }else if(yyyymmdd.length==6){
            return Date.parse(yyyymmdd.substr(0,4)+'/'+yyyymmdd.substr(4,2));
        }
    }

    //获取星期几 dayDate 的格式为 yyyy-MM-dd
    function getWeekDay(dayDate){
        var jsDate = new Date(Date.parse(dayDate.replace(/\-/g,'/')));
        var weekNumber = jsDate.getDay();
        return dayMap[weekNumber];
    }

    function setDatePicker(ec,dateGrp,input){
        if('week_begin'==dateGrp){
        }else if('month_num'==dateGrp){
            datepicker_op.minViewMode=1;
            datepicker_op.format='yyyymm';
        }else{
            datepicker_op.minViewMode=0;
            datepicker_op.format='yyyy-mm-dd';
        }
        input.datepicker('remove');
        input.datepicker(datepicker_op);
        //获取显示的日期数组
        var days_show=ec.getShowDays();
        var days_all=ec.getAllDays();
        //设置时间可选范围
        input.datepicker('setStartDate',new Date(getDate(days_all[0])));
        input.datepicker('setEndDate',new Date(getDate(days_all[days_all.length-days_show.length])));
    }

    function changeDateGrp(item){
        var dateGrpVal = $(item).attr('dateGrp');
        var curDiv = $(item).closest('div[dateGrp]');
        $(curDiv).attr('dateGrp',dateGrpVal);
    }

    function changeIndex(item){
        var indexVal = $(item).val();
        var curDiv = $(item).closest('div[dateGrp]');
        $(curDiv).attr('indexType',indexVal);
    }

    $('.btn-tab button').click(function(e){
        $(this).addClass('active');
        $(this).siblings('button').each(function(){
            $(this).removeClass('active');
        });
    });

    // 路径配置
    require.config({paths: {echarts: "$!{__beat.server.contextPath}/echarts2/dist",dashboard: "$!{__beat.server.contextPath}/js/info"}});
	
    var charts = [];
  
    //简历新增 趋势图
    require(['dashboard/resume_add_v0'],function(totalEC){
        charts.push(totalEC);
        totalEC.show(businessName,2);
    });

// require(['echarts','echarts/chart/line','echarts/chart/bar'],);    

    //简历人群 饼图
    require(['dashboard/resume_crowd_pie_v0'],function(totalEC){
        charts.push(totalEC);
        totalEC.show(businessName);
    });    

// require(['echarts','echarts/chart/pie','echarts/chart/funnel'],);    

	//格式化输出数字
	function format_number(n){
        var b=parseInt(n).toString(); 
        var len=b.length; 
        if(len<=3){return b;} 
        var r=len%3; 
        return r>0?b.slice(0,r)+","+b.slice(r,len).match(/\d{3}/g).join(","):b.slice(r,len).match(/\d{3}/g).join(","); 
    };

    $(window).resize(function(){
        $.each(charts,function(i,n){
            n.resize();
        });
    });

</script>
</html>